package com.leetcode.algorithm.y22.m07;

import com.leetcode.algorithm.common.ListNode;

/**
 * 876. 链表的中间结点
 * 
 * https://leetcode.cn/problems/middle-of-the-linked-list/
 * 
 * @author jie.deng
 *
 */
public class Question0876Solution02 {

	public ListNode middleNode(ListNode head) {
		ListNode slow = head, fast = head;
		while (fast != null && fast.next != null) {
			slow = slow.next;
			fast = fast.next.next;
		}
		return slow;
	}

}
